package com.xianyun.site.iblog.user.executor;

import com.alibaba.cola.catchlog.CatchAndLog;
import com.xianyun.site.iblog.api.user.dubbo.SystemUserEchoService;
import com.xianyun.site.iblog.dto.user.LoginHistorySortQry;
import com.xianyun.site.iblog.dto.user.SystemUserLoginQry;
import com.xianyun.site.iblog.dto.user.data.LoginHistoryDTO;
import com.xianyun.site.iblog.dto.user.data.SystemUserDTO;
import com.xianyun.site.iblog.user.executor.query.LoginHistorySortQryExo;
import com.xianyun.site.iblog.user.executor.query.SystemUserLoginQryExo;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;

/**
 * SystemUser Dubbo 对外服务
 * @author mac_zyj
 */
@Service
@CatchAndLog
@Component
public class SystemUserEchoServiceImpl implements SystemUserEchoService {

    @Autowired
    private SystemUserLoginQryExo systemUserLoginQryExo;

    @Autowired
    private LoginHistorySortQryExo historySortQryExo;

    @Override
    public SystemUserDTO getUserInfoByConditionsForLogin(SystemUserLoginQry systemUserLoginQry) {
        return systemUserLoginQryExo.execute(systemUserLoginQry);
    }

    @Override
    public List<LoginHistoryDTO> selectLoginHistoryBySort(LoginHistorySortQry historySortQry) {
        return historySortQryExo.execute(historySortQry);
    }

}
